<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

$this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title;
?>
  <div class="weui_tab login">

    <div class="weui_navbar topFixed">
      <a href="/" style="color:#333"><i class="iconfont icon-return"></i></a>
      <span class="navTt">登录</span>
      <a href="/" style="color:#333"><i class="iconfont icon-home"></i></a>
    </div>

    <div class="weui_tab_bd">

      <?php $form = ActiveForm::begin(['method'=>'post'/*'options' => ['class' => 'positionr']*/]);?>

      <div class="weui_cells weui_cells_form">
        <div class="weui_cell">
          <div class="weui_cell_hd"><label class="weui_label">账号</label></div>
          <div class="weui_cell_bd weui_cell_primary">

            <?= $form
              ->field($model, 'phone')
              ->label(false)->error(false)
              ->textInput(['maxlength' => 11,'placeholder'=>'请输入手机号码','class'=>'weui_input','onkeyup'=>"this.value=this.value.replace(/\D/g,'')"]) ?>

          </div>
        </div>
        <div class="weui_cell">
          <div class="weui_cell_hd"><label class="weui_label">密码</label></div>
          <div class="weui_cell_bd weui_cell_primary">

              <?= $form
                ->field($model, 'password')
                ->label(false)->error(false)
                ->passwordInput(['placeholder' => '请输入密码','autocomplete'=>'off','class'=>'weui_input']) ?>

          </div>
          <div class="weui_cell_bd">
            <a href="javascript:" class="weui_icon_clear" id="search_clear"></a>
          </div>
        </div>
      </div>

      <div class="content-pad">
        <?= Html::submitButton('立即登录', ['class' => 'weui_btn']) ?>
        <p class="links autoHeight">
          <a href="/site/forget" class="left">找回密码</a>
          <a href="/site/register" class="right">免费注册</a>
        </p>
      </div>

      <?php ActiveForm::end(); ?>

      <div class="footer">
        <div class="icons autoHeight">
          <dl>
            <dt><img src="http://static.tianpinwang.com.cn/v1/mobile/images/footIcon01.png" alt=""></dt>
            <dd>厂家直供</dd>
            <dd>正品保障</dd>
          </dl>
          <dl>
            <dt><img src="http://static.tianpinwang.com.cn/v1/mobile/images/footIcon02.png" alt=""></dt>
            <dd>免费拿样</dd>
            <dd>批发无忧</dd>
          </dl>
          <dl>
            <dt><img src="http://static.tianpinwang.com.cn/v1/mobile/images/footIcon03.png" alt=""></dt>
            <dd>全国送达</dd>
            <dd>48小时发货</dd>
          </dl>
        </div>
        <ul class="navs autoHeight">
          <li><a href="/">首页</a></li>
          <li><a href="/help">常见问题</a></li>
          <li><a href="/">收藏夹</a></li>
          <li><a href="/">我的添品</a></li>
        </ul>
        <p class="copyRight">添品网版权所有2015~2016</p>
      </div>

    </div>


  </div>

  <script>
    $(function(){
      var $clear=$('#search_clear');
      $('.weui_input:password').keyup(function(){
        if($(this).val().length>1){
          $clear.css('display','block');
        }else {
          $clear.css('display','none');
        }
      });

      $clear.click(function(){
        $('.weui_input:password').val('');
        $(this).css('display','none');
      })
    })
  </script>